<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>事件处理</title>
    <script src="./js/vue.js"></script>
</head>
<body>
    <div id="root">
        <h1>欢迎来到{{name}}!!!</h1>
        <button v-on:click="showInfo">点击我，看效果</button>
        <button @click="showInfo2($event, 666)">点击我，看效果</button>
    </div>
    
</body>
<script>
    Vue.config.productionTip = false
    const vm = new Vue({
        el: "#root",
        data: {
            name: "Vue"
        },
        methods: {
            showInfo(){
                alert("你好，Vue!!!")
            },
            showInfo2(event, number) {
                console.log(event.target)
                console.log(event, number)
            }
        }
    })
</script>
</html>